﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SYH.Public.Model;
using System.Data;

namespace SYH.Public.BLL
{
    public class Gallery
    {
        private static readonly SYH.Public.DAL.Gallery dal = new DAL.Gallery();

        /// <summary>
        /// 获取指定用户的相册列表信息
        /// </summary>
        /// <param name="user">用户编号</param>
        /// <returns></returns>
        public List<Alums> GetAlums(int userId)
        {
            return dal.GetAlums(userId);
        }

         /// <summary>
        /// 获取指定用户的相册列表信息
        /// </summary>
        /// <param name="user">用户编号</param>
        /// <returns></returns>
        public DataTable GetAlum(int userId)
        {
            return dal.GetAlum(userId);
        }

         /// <summary>
        /// 获取相册下的所有图片（分页方式）
        /// </summary>
        /// <param name="alumsId"></param>
        /// <param name="pageSize"></param>
        /// <param name="pageIndex"></param>
        /// <param name="allCount"></param>
        /// <returns></returns>
        public List<Image> GetImages(int alumsId, int pageSize, int pageIndex, out int pageCount, out int recordCount)
        {
            return dal.GetImages(alumsId,  pageSize,  pageIndex, out  pageCount, out  recordCount);
        }

        /// <summary>
        /// 获取相册下的所有图片（分页方式）
        /// </summary>
        /// <param name="alumsId"></param>
        /// <param name="pageSize"></param>
        /// <param name="pageIndex"></param>
        /// <param name="allCount"></param>
        /// <returns></returns>
        public DataTable GetAblumnImages(int alumsId, int pageSize, int pageIndex, out int pageCount, out int recordCount)
        {
            return dal.GetAblumnImages(alumsId, pageSize, pageIndex, out  pageCount, out  recordCount);
        }

         /// <summary>
        /// 创建相册
        /// </summary>
        /// <param name="alumsName">相册名字</param>
        /// <param name="userId">用户编号</param>
        /// <returns></returns>
        public int CreateAlums(string alumsName, int userId)
        {
            return dal.CreateAlums(alumsName,userId);
        }

         /// <summary>
        /// 将图片添加到相册中
        /// </summary>
        /// <param name="imageName">图片名称</param>
        /// <param name="alumnId">相册编号</param>
        public int InsertImageToAlums(int alumnId, string imageName, int UserId, string title)
        {

            return dal.InsertImageToAlums( alumnId,  imageName,  UserId,  title);
            
        }
    }
}
